package com.lilinling.yinzhi.model.controller;

import java.util.Arrays;
import java.util.Map;

//import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import com.lilinling.yinzhi.model.entity.MmsPanelContentEntity;
import com.lilinling.yinzhi.model.service.MmsPanelContentService;
import com.lilinling.common.utils.PageUtils;
import com.lilinling.common.utils.R;



/**
 * 
 *
 * @author lichenglin
 * @email lilinling15@gmail.com
 * @date 2021-03-12 00:12:41
 */
@RestController
@RequestMapping("model/mmspanelcontent")
public class MmsPanelContentController {
    @Autowired
    private MmsPanelContentService mmsPanelContentService;

    /**
     * 列表
     */
    @RequestMapping("/list")
    //@RequiresPermissions("model:mmspanelcontent:list")
    public R list(@RequestParam Map<String, Object> params){
        PageUtils page = mmsPanelContentService.queryPage(params);

        return R.ok().put("page", page);
    }


    /**
     * 信息
     */
    @RequestMapping("/info/{id}")
    //@RequiresPermissions("model:mmspanelcontent:info")
    public R info(@PathVariable("id") Integer id){
		MmsPanelContentEntity mmsPanelContent = mmsPanelContentService.getById(id);

        return R.ok().put("mmsPanelContent", mmsPanelContent);
    }

    /**
     * 保存
     */
    @RequestMapping("/save")
    //@RequiresPermissions("model:mmspanelcontent:save")
    public R save(@RequestBody MmsPanelContentEntity mmsPanelContent){
		mmsPanelContentService.save(mmsPanelContent);

        return R.ok();
    }

    /**
     * 修改
     */
    @RequestMapping("/update")
    //@RequiresPermissions("model:mmspanelcontent:update")
    public R update(@RequestBody MmsPanelContentEntity mmsPanelContent){
		mmsPanelContentService.updateById(mmsPanelContent);

        return R.ok();
    }

    /**
     * 删除
     */
    @RequestMapping("/delete")
    //@RequiresPermissions("model:mmspanelcontent:delete")
    public R delete(@RequestBody Integer[] ids){
		mmsPanelContentService.removeByIds(Arrays.asList(ids));

        return R.ok();
    }

}
